<?php
// +----------------------------------------------------------------------
// | 座位 模型
// +----------------------------------------------------------------------
namespace app\wechat\model;
use think\Model;

class Seat extends Model{
    /**
     * 获取分区座位总数
     * @param int $areaid 选中的ID
     * @return int
     */
	public function getTotal($areaid){
		$total = self::where('areaid',$areaid)->count();
		return $total;
	}
    /**
     * 获取分区座位
     * @param int $areaid 选中的ID
     * @return array
     */
	public function getSeatArr($areaid){
    	$seat = new Seat;
    	$res = $seat->where('areaid',$areaid)->select();
    	return $res;
	}
    /**
     * 获取座位信息
     * @param int $seatid 选中的ID
     * @return string
     */
    public function getSeatInfo($seatid){
        $seat = new Seat;
        $res = $seat->where('id',$seatid)->field('areaid,seatNum,seatType')->find();
        return $res;
    } 
}